{% extends "core.html" %}
{% load i18n %}

{% block title %}Ahmia - Create hs description{% endblock %}
{% block body %}
<div id="ahmiaAboutPage">
  <div class="aboutAhmia">
    <script type="text/javascript">
      function generate() {
        var json = document.getElementById("json");

        var title = document.getElementById("title").value;
        var description = document.getElementById("description").value;
        var relation = document.getElementById("relation").value;
        var subject = document.getElementById("subject").value;
        var type = document.getElementById("type").value;
        var language = document.getElementById("language").value;
        var contactInformation = document.getElementById("contactInformation").value;

        replaceContent(json, 'title"', '",', ': "' + title);
        replaceContent(json, 'description"', '",', ': "' + description);
        replaceContent(json, 'relation"', '",', ': "' + relation);
        replaceContent(json, 'keywords"', '",', ': "' + subject);
        replaceContent(json, 'type"', '",', ': "' + type);
        replaceContent(json, 'language"', '",', ': "' + language);
        replaceContent(json, 'contactInformation"', '" ', ': "' + contactInformation);

        $('#json').show();

        return false;
      }

      function replaceContent(element, start, stop, replacement) {
        var content = element.innerHTML;
        var pattern = new RegExp(start + ".*" + stop, "g");
        element.innerHTML = content.replace(pattern, start + replacement + stop);
      }
    </script>

    <h2>Generate hidden service descriptions</h2>

    <noscript>
  <p>WE DO NOT WANT TO HAVE ANY LOGS. ENABLE JAVASCRIPT (CLIENT SIDE).</p>
</noscript>
    <p>
      JSON is genereted in your client side: no information is sent over network. Safe for you!
    </p>

    <div class="editor">
      <form>
        <fieldset>
          <p>
            <label>Title</label>
            <input type='text' name='title' id='title' value='' class='input-text'
                   placeholder='eg. Wikileaks' size='40' />
          </p>
          <p>
            <label>Description</label>
            <textarea name='description' id='description' rows='3' cols='39'
                      class='input-text' placeholder='description of the website'></textarea>
            <p>
              <label>Relation (if there is a same page in different domain)</label>
              <input type='text' name='relation' id='relation' value=''
                     class='input-text' placeholder='eg. http://wikileaks.org/' size='40' />
            </p>
            <p>
              <label>Keywords</label>
              <input type='text' name='subject' id='subject' value='' class='input-text'
                     placeholder='eg. classified documents, international organizations etc'
                     size='40' />
            </p>
            <p>
              <label>Type (example: wiki/forum/news/blog/upload)</label>
              <input type='text' name='type' id='type' value='' class='input-text'
                     placeholder='eg. document archive and disclosure, wiki' size='40' />
            </p>
            <p>
              <label>Language (en/de/fr/fi/sv/es/pl/ru...)</label>
              <input type='text' name='language' id='language' value='' class='input-text'
                     placeholder='eg. en' size='40' />
            </p>
            <p>
              <label>Contact Information</label>
              <input type='text' name='contactInformation' id='contactInformation' value=''
                     class='input-text' placeholder='email etc' size='40' />
            </p>
            <input type='button' style="float: right;" name='button' value='Generate'
                   class='input-add' onClick="generate();" size='40' />

        </fieldset>
      </form>
    </div>
    <div class="aboutTeam">
      <br style="clear: left;" />
    </div>
    <h3>JSON:</h3>
    <pre class="precode">
<code id="json" style="display: none;">
{
   "title": "",
   "description": "",
   "relation": "",
   "keywords": "",
   "type": "",
   "language": "",
   "contactInformation": ""
}
</code>
</pre>

    <p>
      Copy paste the JSON text to your hidden service so it is available under
      <b>http://3g2upl4pq6kufc4m.onion/description.json</b> and our robot will find
      and use this as an official information about your site. Please make sure that
      your JSON description is valid JSON. Use exactly the file name description.json
      and be sure that it is accessible under your hidden service.
    </p>
  </div>

  <div class="credits">
    <ul>
      <li><img src="/static/images/logos/globaleaks.png"
               alt="{% trans " Globaleaks Platform " %}"></li>
      <li><img src="/static/images/logos/tor2web.png"
               alt="{% trans " Tor2Web Platform " %}"></li>
      <li><img src="/static/images/logos/hermes.png"
               alt="{% trans " HERMES Center for Transparency and Digital Rights " %}"></li>
      <li><img src="/static/images/logos/torproject.png"
               alt="{% trans " Tor Project " %}"></li>
    </ul>
  </div>
</div>
{% endblock %}
